package com.yanwq.sayhi.rest;

import com.yanwq.sayhi.bean.ArticleAttitude;
import com.yanwq.sayhi.service.ArticleAttitudeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * 作者：yanweiqiang。
 * 日期：2016/8/4 0004。
 */
@RestController
@RequestMapping(path = "/article/attitude")
public class ArticleAttitudeRest {

    @Autowired
    private ArticleAttitudeService service;

    @RequestMapping(path = "/add")
    public ArticleAttitude save(@RequestBody ArticleAttitude articleAttitude) {
        articleAttitude.setUuid(UUID.randomUUID().toString());
        articleAttitude.setPublishTime(System.currentTimeMillis());
        return service.add(articleAttitude);
    }
}
